import Common from '../../../common/common.js';
let common = new Common;
const app = getApp()
Page({
  data: {
    id: '',
    pageNumber: '',
  },
  onLoad: function (options) {
    this.setData({
      id: options.id,
      messageId: options.messageId,
      pageNumber: options.pageNumber
    })
    this.queryUserMessageInfo()
  },
  onShow: function () { },
  queryUserMessageInfo() {
    let data = {
      "size": 10,
      "current": this.data.pageNumber,
      "condition": {
        messageId: this.data.id,
        orgSeq: app.globalData.orgSeq,
      }
    }
    common.requestAjax('/api/user-service/v1/userMessage/queryUserMessageInfo', 'POST', data).then(res => {
      if (res.data.code == 1) {
        let noticeList = res.data.records[0];
        noticeList.messageContentList = noticeList.messageContent.split('\\n')
        this.setData({
          noticeList,
        })
      } else {
        common.showToast(res.data.message);
      }
    })
  },
  copy: function (e) {
    let that = this;
    wx.setClipboardData({
      data: that.data.noticeList.messageContent,
      success: function (res) {
        wx.getClipboardData({
          // 这个api是把拿到的数据放到电脑系统中的
          success: function (res) {
          }
        })
      }
    })
  },
})